package com.bibrApp.difu.actvity.uaccount_info_mvp;

import android.text.TextUtils;

import androidx.annotation.NonNull;

import com.bibrApp.difu.DfApp;
import com.bibrApp.difu.R;
import com.bibrApp.difu.utils.AppManager;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.ArrayList;

public class AccountInfoAdapter extends BaseQuickAdapter<AccountInfoBean, BaseViewHolder> {
    public AccountInfoAdapter() {
        super(R.layout.item_account_info, new ArrayList<>());
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, AccountInfoBean item) {
        helper.setVisible(R.id.btn_add, getData().indexOf(item) == getItemCount() - 1);
        DfApp dfApp = (DfApp) AppManager.getTopActivity().getApplication();
        helper.setText(R.id.tv_account, TextUtils.isEmpty(dfApp.getBlance())?"0.000000BTC":dfApp.getBlance()+"BTC");
        helper.addOnClickListener(R.id.btn_add);
    }
}
